package me.sunsy.kit.test

open class Base {

    constructor() {
        method(100)
    }

    open fun method(i: Int) {
        println("base i is $i")
    }

}

class Sub : Base {

    constructor() {
        super.method(70)
    }

    override fun method(i: Int) {
        println("sub i is $i")
    }

}

class Student {
    private var name: String
    private var age: Int

    constructor() {
        this.name = "张三"
        this.age = 10
    }

    constructor(name: String, age: Int) {
        this.name = name
        this.age = age
    }

    override fun toString(): String {
        return "我叫$name，今年${age}岁了"
    }
}